package com.tmt.im.manager.mapstruct;

import com.tmt.im.common.pojo.SystemNotifyPoJo;
import com.tmt.im.manager.controller.vo.SystemNotifyVoEx;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/8/25 15:04
 * @Version 1.0
 **/
@Component
@Mapper(componentModel = "spring")
public interface SystemNotifyMapStruct {

    @Mappings({
            @Mapping(target = "updateTime", expression = "java(com.tmt.im.manager.helper.SystemNotifyHelper.getUpdateTime(notify.getUpdateTime()))"),
            @Mapping(target = "createTime", expression = "java(com.tmt.im.manager.helper.SystemNotifyHelper.getCreateTime(notify.getCreateTime()))")
    })
    SystemNotifyVoEx toSystemNotifyVoEx(SystemNotifyPoJo notify);

    List<SystemNotifyVoEx> toSystemNotifyVoExs(List<SystemNotifyPoJo> notifies);

}
